This is a creation in
Article, where the information may have evolved or changed.
1. Introduction
Recently in the study of some message middleware, commonly used MQ such as Rabbitmq,activemq,kafka. NSQ is a distributed real-time messaging platform based on the Go language, which is based on the MIT Open Source protocol, an easy-to-use message middleware developed by Bitly Corporation.The official and third
This is a creation in
Article, where the information may have evolved or changed.
1. Introduction
Recently in the study of some message middleware, commonly used MQ such as Rabbitmq,activemq,kafka. NSQ is a distributed real-time messaging platform based on the Go language, which is based on the MIT Open Source protocol, an easy-to-use message middleware developed by Bitly Corporation.The official and third
This is a creation in
Article, where the information may have evolved or changed.
Why to use NSQ
has recently been looking for a high-performance, highly available message queue to do communication between internal services. At first think of using ZEROMQ, but in the process of finding information, accidentally found NSQ this Golang developed message queue, after all, is Golang original things, full-feature
This is a creation in
Article, where the information may have evolved or changed.
Why to use NSQ
has recently been looking for a high-performance, highly available message queue to do communication between internal services. At first think of using ZEROMQ, but in the process of finding information, accidentally found NSQ this Golang developed message queue, after all, is Golang original things, full-feature
This is a creation in
Article, where the information may have evolved or changed.
NSQ is a distributed real-time messaging platform based on the Go language, which is based on the MIT Open Source protocol, which is hosted on GitHub and is currently the latest version of the 0.3.1 version. NSQ can be used for real-time messaging services in large-scale systems and can handle hundreds of millions of levels of
Resources:1. In-depth NSQ tour: http://www.oschina.net/translate/day-22-a-journey-into-nsq2. NSQ Source: https://github.com/bitly/nsq/3. NSQ Source Interpretation: http://www.baiyuxiong.com/?p=873After reading the above several articles, to nsq have a certain understanding,
This is a creation in
Article, where the information may have evolved or changed.
NSQ is using the source code to compile the installation.
Compile and install using source code to build a separate gopath to prevent confusion with the original program
The environment used is UBUNTU14
1. Install git:apt-get installed git first2, go environment and Gopath set directly skip the self-Baidu3. Install Godep:go get GITHUB.COM/KR/GODEP4. Install Assert:go
This is a creation in
Article, where the information may have evolved or changed.
First in the local service run up, I use docker-compose, a sentence 6666
First create a new docker-compose.ymlversion: ' 2 ' services: nsqlookupd: image:nsqio/nsq command:/NSQLOOKUPD Ports: -"192.168.9.111:4160:4160" -"192.168.9.111:4161:4161" nsqd: image:nsqio/nsq command :/nsqd--lookupd-tcp-address
This is a creation in
Article, where the information may have evolved or changed.
Because business needs, need to use NSQ. So I learned the next NSQ. First is the installation, I am on my own computer, tend to source code installation. The first is the source installation can install the latest code, the second is the entire installation process can be controlled.
However, some pits were encountered during
This is a creation in
Article, where the information may have evolved or changed.
NSQ is a real-time message queue written by bitly company using Golang.
NSQ official currently provides GOLANG,PY,JS client, this article briefly describes the use of Golang client writer.
The official Go client library is here: github.com/bitly/go-nsq
GO-
1. InstallationRefer:Http://nsq.io/deployment/installing.htmlHttp://www.baiyuxiong.com /? P = 873 (recommended .)It is not recommended to directly drop the official binary releases version down and drop the bin directory.We recommend that you use the "Building from source" method (refer to the following steps). In this way, you can lower the source to $ gopath/src and build the program into $ gopath/bin at the same time. (then add the bin directory to the environment variable $ sudo VI/etc/profi
In order to solve the problem of blocking caused by high concurrency, the problem is usually solved by Message Queuing.A recent study of the NSQ framework for the next Golang Message Queue (HTTP/ Nsq.io), but also hands-on to achieve such a function: through the NSQ producer mass production messages to nsq push to form a message queue, and then through the
This is a creation in
Article, where the information may have evolved or changed.
Transferred from: http://www.baiyuxiong.com/?p=886-----------------------------------------------------------------------
Previous Go Language nsq Source Interpretation-Basic introduction introduced the most basic NSQ environment construction and use. In the last use, we used several commands: NSQLOOKUPD, NSQD, nsqadmin, curl,
This is a creation in
Article, where the information may have evolved or changed.
NSQ Source Learning
Brief introduction
NSQ is a distributed queue implemented with the go language. Read the source of the Chanel of the Go language, distributed has a better understanding
Code structure
The core code is divided into 3 parts:
NSQD: Queue data store
Nsqlookup: Managing NSQD nodes, service discovery
Exiting a running program can be rough kill-9 $PID, but this will disrupt the integrity of the business, it is possible that one is executing in the middle of the logic, resulting in abnormal garbage data.This article summarizes in go language, how can gracefully exit the network application, involves the knowledge including: Signal,channel,waitgroup and so on.From here: Https://gobyexample.com/channel-synchronization can simply learn how to use the channel in go to achieve goroutines synchroniz
This is a creation in
Article, where the information may have evolved or changed.
Exiting a running program can be rough kill-9 $PID, but this will disrupt the integrity of the business, it is possible that one is executing in the middle of the logic, resulting in abnormal garbage data.This article summarizes in go language, how can gracefully exit the network application, involves the knowledge including: Signal,channel,waitgroup and so on.From here: Https://gobyexample.com/channel-synchronizat
This is a creation in
Article, where the information may have evolved or changed.
# # NSQ Introduction NSQ is a real-time distributed messaging platform designed to handle a large number of 1 billion-level messages per day. The NSQ has a distributed and decentralized topology that features no single point of failure, fault tolerance, high availability, and the ab
This is a creation in
Article, where the information may have evolved or changed.
Exiting a running program can be rough kill-9 $PID, but this will disrupt the integrity of the business, it is possible that one is executing in the middle of the logic, resulting in abnormal garbage data.
This article summarizes in go language, how can gracefully exit the network application, involves the knowledge including: Signal,channel,waitgroup and so on.
From here: Https://gobyexample.com/channel-synchroniz
, the function of which is to subscribe to a topic and channel, when producer to the channel to send messages, the message printed on the screen. You want to further understand the server NSQD through the process of interaction. As follows
package mainimport ( "fmt" nsq "github.com/nsqio/go-nsq")func main() { config := nsq.NewConfig() c, err := nsq.NewConsumer("
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.